package com.jiantong.work.enums;

/**
 * Created by niufei on 2017/4/24.
 *
 */
public enum DrugPurchaseRecordStatus {

    UNCOMMITTED(0,"未提交"),
    FINISHED(1,"完成");
    private final Integer value;
    private final String description;

    DrugPurchaseRecordStatus(Integer value, String description) {
        this.value = value;
        this.description = description;
    }

    public static DrugPurchaseRecordStatus from(Integer value) {
        for (DrugPurchaseRecordStatus drugPurchaseRecordStatus : DrugPurchaseRecordStatus.values()) {
            if (drugPurchaseRecordStatus.value.equals(value)) {
                return drugPurchaseRecordStatus;
            }
        }
        return null;
    }

    public Integer value() {
        return this.value;
    }

    @Override
    public String toString() {
        return description;
    }
}
